function* foo(x) {
  let y = 2 * (yield (x + 1))
  let z = yield (y / 3)
  // x=5 y=24 z=13
  return (x + y + z)
}
let it = foo(5)
console.log(it.next())   // => {value: 6, done: false}
console.log(it.next(12)) // => {value: 8, done: false}
console.log(it.next(13)) // => {value: 42, done: true}

// next传入参数等于上一个yield返回值